﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Peer.Data
{
    [AttributeUsage(AttributeTargets.Class)]
    public class DbTableAttribute : Attribute
    {
        private string _name;
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
            }

        }
        public DbTableAttribute()
        {
            Name = string.Empty;
        }
        public DbTableAttribute(string name)
        {
            Name = name;
        }
    }
    [AttributeUsage(AttributeTargets.Property)]
    public class DbColumnAttribute : Attribute
    {
        private string _name;
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
            }
        }
        bool _isPrimary;
        public bool IsPrimary
        {
            get
            {
                return _isPrimary;
            }
            set
            {
                _isPrimary = value;
            }
        }
        bool _isDelTag;
        public bool IsDelTag {
            get
            {
                return _isDelTag;
            }
            set
            {
                _isDelTag = value;
            }
            }
        public DbColumnAttribute()
        {
            Name = string.Empty;
        }
        public DbColumnAttribute(string name)
        {
            Name = name;
            IsPrimary = false;
        }
    }
}
